package com.zhixing.common.utils;

import com.zhixing.common.domain.entity.UserInfo;

public class UserContext {
    public final static ThreadLocal<UserInfo> threadLocal = new ThreadLocal<>();

    public static void setUserInfo(UserInfo userInfo) {
        threadLocal.set(userInfo);
    }

    public static UserInfo getUserInfo() {
        return threadLocal.get();
    }

    public static void remove() {
        threadLocal.remove();
    }
}
